﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace Vit.Web.Extensions
{
    public static class MvcHtmlStringExtensions
    {
        public static MvcHtmlString Wrap(this MvcHtmlString html, string before, string after)
        {
            return Wrap(html, string.Concat(before, "{0}", after));
        }

        public static MvcHtmlString Wrap(this MvcHtmlString html, string wrapHtmlFormat)
        {
            return new MvcHtmlString(string.Format(wrapHtmlFormat, html.ToHtmlString()));
        }

        public static MvcHtmlString Append(this MvcHtmlString html, string content)
        {
            return new MvcHtmlString(string.Concat(html.ToHtmlString(), content));
        }

        public static MvcHtmlString Append(this MvcHtmlString html, MvcHtmlString html2)
        {
            return html.Append(html2.ToHtmlString());
        }
    }
}
